package com.example.edu.school.visitor.impl;

import com.example.edu.school.user.impl.Student;
import com.example.edu.school.user.impl.Teacher;
import com.example.edu.school.visitor.Visitor;

/**
 * 校长访问者
 */
public class PrincipalVisitor implements Visitor {

    @Override
    public void visit(Student student) {
        System.out.println(String.format("%20s", "校长访问学生信息"));
        System.out.println(String.format("姓名：%-5s" + "家庭背景：%-7s" + "分科：%-5s" + "排名：%s", student.name, student.classOrigin, student.identity, student.ranking()));
    }

    @Override
    public void visit(Teacher teacher) {
        System.out.println(String.format("%20s", "校长访问老师信息"));
        System.out.println(String.format("姓名：%-5s" + "级别：%-7s" + "升学率：%s", teacher.name, teacher.identity, teacher.enrollmentRate()));
    }
}
